package net.mcreator.infinite_storage.procedure;

import net.minecraft.world.World;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.Entity;

import net.mcreator.infinite_storage.gui.GuiSmallBagGui;
import net.mcreator.infinite_storage.InfiniteStorageMod;
import net.mcreator.infinite_storage.ElementsInfiniteStorageMod;

import java.util.Map;
import java.util.HashMap;

@ElementsInfiniteStorageMod.ModElement.Tag
public class ProcedureSamllBagRightClick extends ElementsInfiniteStorageMod.ModElement {
	public ProcedureSamllBagRightClick(ElementsInfiniteStorageMod instance) {
		super(instance, 38);
	}
	static Map<String, Object> $_dependencies = new HashMap<>();
	public static void executeProcedure(Map<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			return;
		}
		if (dependencies.get("itemstack") == null) {
			return;
		}
		if (dependencies.get("x") == null) {
			return;
		}
		if (dependencies.get("y") == null) {
			return;
		}
		if (dependencies.get("z") == null) {
			return;
		}
		if (dependencies.get("world") == null) {
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		ItemStack itemstack = (ItemStack) dependencies.get("itemstack");
		int x = (int) dependencies.get("x");
		int y = (int) dependencies.get("y");
		int z = (int) dependencies.get("z");
		World world = (World) dependencies.get("world");
		if ((((entity instanceof EntityLivingBase) ? ((EntityLivingBase) entity).getHeldItemMainhand() : ItemStack.EMPTY).getItem() == (itemstack)
				.getItem())) {
			{
				$_dependencies.put("entity", entity);
				ProcedureOldBagOpen.executeProcedure($_dependencies);
			}
			if (entity instanceof EntityPlayer)
				((EntityPlayer) entity).openGui(InfiniteStorageMod.instance, GuiSmallBagGui.GUIID, world, x, y, z);
		}
	}
}
